<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div style="height: 100%; padding-top: 30px" class="bg_color_common">
	<form enctype="multipart/form-data" method="post" target="post_frame" action="" name="uploadImag" id="uploadImag">
		<iframe style="display:none;" id="post_frame" name="post_frame">
        </iframe>
        <input type="hidden" value="" name="uploadImageStatus" id="uploadImageStatus">
        <input type="hidden" value="" name="msg" id="msg">
		<table width="98%">
			<tbody>
			<tr>
				<td>
					<table width="380">
					<tbody>
						<tr>
							<td style="width: 130px" class="td_title">名称:</td>
							<td "="" style="width: 200px">
								<input type="text" name="name">
								<img alt="如果不填写文件名，上传的文件将采用上传文件的原始文件名。" src="/images/common/help.png">
							</td>
						</tr>
						<tr>
							<td class="td_title">如果存在,是否覆盖:</td>
							<td>
								<input type="radio" checked="checked" value="yes" name="cover">是
								<input type="radio" value="no" name="cover">否
							</td>
						</tr>
						<tr>
							<td class="td_title">图片路径:
							</td>
							<td>
								<input type="file" onchange="checkBeforeOfUploadOrImport('file','image','hintBgUpload');" id="file" name="file" style="height: 22px;">
							</td>
						</tr>
					</tbody>
					</table>
				
					<input type="hidden" value="bg" name="type">
				
				
				</td>
				<td valign="top" style="padding-left:10px;border-style:solid;border-width:2px;">
					<div>上传规则:<br>请上传类型为.jpg, .jpeg, .gif, .bmp, .png的图片!</div>
				</td>
			</tr>
		</tbody></table>
	</form>
	<!-- <center>
		<div id="hintBgUpload" style="border: 1px solid; height: 40px; width: 80%; text-align: left; display: none" class="border_color_darkgray">
		</div>
	</center> -->
</div>


<script type="text/javascript">

	//添加背景图
	function add(){
		//PigossWindow.show('/jsp/topo/bgUpload.jsp?iconLabels=china.jpg/world.jpg/china2.jpg',0,undefined,450,200);
		var butHTML = "<a href=\"javascript:addImage();\" class='buttonlink txbtip' title='确定'><img width='16' height='16' src='/images/common/save.gif'/><p>确定</p></a><img src='/images/common/shux.gif' class='split'/>";
		PigossMsg.showWin("/jsp/topo/bgUpload.jsp?iconLabels=china.jpg/world.jpg/china2.jpg","增加背景图片",560,235,butHTML);
	}
	function addImage(){
		var file = document.getElementById('file').value;
		var isImage = false;
		if(file == ""){
			PigossMsg.alert('上传背景图片不能为空!');
		}else{
			r type = file.substr(file.lastIndexOf(".")).toLowerCase();
			if(type == '.jpg' || type == '.gif' || type == '.bmp' || type == '.png' || type == '.jpeg'){
				isImage = true;
			}
			if(!isImage){
				PigossMsg.alert('上传背景图片不合法!');
			}else{
				document.getElementById("uploadImag").action='topoImag_upload.action';
				document.charset='utf-8';
				document.uploadImag.submit();
			};
		};
	};
	

</script>



